
#include "StdAfx.h"
#include <vector>
#include "NodeMap.h"

class CTaxiAgent;

class CDijkstras
{
public:
    CDijkstras(CNodePtrVec* vecNodes, int(*dist)(CNode*, CNode*));
    ~CDijkstras(void);

    void SetSource(CNode* source);
    CPath* GetPath(CNode* source, CNode* dest);
    CPath* GetPathTo(CNode* dest);

protected:
	void Run();
	void GetAdjacentNodes(CNode* node, CNodePtrVec& vecAdjNodes);
	CNode* GetSmallestNode();
	bool NodeInList(CNode* node);
	void PrintShortestRouteTo(CNode* destination, CNodePtrVec& vecPath);

    int(*m_fxDist)(CNode*, CNode*);
    CNode* m_source;
	CNodePtrVec m_vecNodes;
    CNodePtrVec m_vecNodesCopy;
};